package main

import (
	"log"
	"os"
	"test-go/day7"
)

func main() {

	//fmt.Println("I am main")
	//day7.TestInit()

	//day7.TestInit()

	//day7.CreateFile()
	//path := make(map[string][]string)
	//
	//day7.Start("D:\\vscode_workplace", path)
	//fmt.Println(path)

	//defer fmt.Println("出发 defer")
	//fmt.Println("正常运行")
	//
	//log.Println("haha", ":", "heihei")
	//
	//log.Panicln("手动添加异常")

	day7.TestLog()
	log.Println("hello world")

}

func init() {
	i := log.Flags()
	log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
	log.Println("打印 i = ", i)
	log.Println("Test log day7")
	f, err := os.OpenFile("go.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
	defer f.Close()
	if err != nil {
		log.Panic("打开日志文件异常！！！")
	}
	log.SetOutput(f)
	log.Println("Test go.log")
}
